package com.avengers.common.bean.enums;

/**
 * @author zhangnan
 * @since 2022/11/9 9:29 上午
 **/
public enum DomainRetrieveStatus {
    WAIT(0, "待取回"),
    DEAL(1, "取回中"),
    SUCCESS(2, "取回成功"),
    FAIL(3, "取回失败"),
    WAIT_ADD(5, "等待添加域名"),
    WAIT_MOD_DNS(6, "等待修改DNS"),
    INIT_SUCCESS(9, "无需取回");

    public Integer value;
    public String comment;

    DomainRetrieveStatus(Integer value, String comment) {
        this.value = value;
        this.comment = comment;
    }

    public static DomainRetrieveStatus of(Integer value) {
        for (DomainRetrieveStatus domainRetrieveStatus : values()) {
            if (domainRetrieveStatus.value.equals(value)) {
                return domainRetrieveStatus;
            }
        }
        return null;
    }
}